<script lang="ts" setup>
import { ref } from 'vue'
import axios from 'axios';
const tableData = ref([])

const getData = async () => {
  const res = await axios.get('/api/spuList')
  tableData.value = res.data
}
getData()

</script>

<template>
  <el-card>
    <el-button type="primary">新增SPU</el-button>
  </el-card>
  <el-card style="margin-top: 40px;">
    <el-table :data="tableData" stripe>
      <el-table-column type="index" label="序号" width="80"></el-table-column>
      <el-table-column prop="goodsname" label="SPU名称"></el-table-column>
      <el-table-column prop="goodsdescribe" label="SPU描述"></el-table-column>
      <el-table-column label="操作">
        <template #default="{ row }">
          <el-button type="primary" size="small">编辑</el-button>
          <el-button type="warning" size="small">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<style scoped lang="scss"></style>